<template>
    <div class="g-son">
        <h3>子组件</h3>
        <button @click="bindConfrim">传参</button>
    </div>
</template>

<script setup>
import { ref } from 'vue';
const emit = defineEmits(['change']) // 1. 定义事件

const message = ref('我是子组件内容')

const bindConfrim = ()=>{
    emit('change',message.value) // 触发自定义change事件
}


</script>

<style lang="css" scoped>
.g-son{
    width: 200px;
    height: 200px;
    background-color: pink
}
</style>